﻿using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
using LitJson;


public class TestData : MonoBehaviour {

    void Start()
    {
        //LoadScene.LoadSenceXML();
        LoadScene.LoadSenceJSON();
    }


	void Update () {
	    if(Input.GetKeyDown(KeyCode.J))
        {
            GameDataManager._instance.Save();
        }
        if(Input.GetKeyDown(KeyCode.K))
        {
            GameDataManager._instance.Load();
            List<DataBase> datas = GameDataManager._instance.cloneData.datas;
            for(int i = 0 ; i < datas.Count ; i ++)
            {
                GameObject go = GameObject.Find(datas[i].objName);
                go.GetComponent<DataItem>().Load(datas[i]);
                
            }
        }
	}
}
